// JavaScript Document
function onSubmitForm(formName,url)
{ 
	var theForm = document.getElementById(formName);
	theForm.action = url;	
	theForm.submit();	
	return true;
  
}
function areaLoadUrl(area, url){
	$(area).load(url);
}

function goPage(){
	alert(this.value);
}

function submitQuestion(formName,url,question)
{ 
	
	var answer = confirm(question);
	//alert(answer);
	if (answer){
		var theForm = document.getElementById(formName);
		theForm.action = url;	
		theForm.submit();	
		return true;
	}
  
}

function changeLang(url, type,lang)
{ 
	
	var goUrl = url + '/type/' + type + '/lang/' + lang;
	window.location = goUrl;
}

var checked=false;
var checkValue;

function checkedAll(formName, checkboxName) {
    var theForm = document.getElementById(formName);;
    if (checked == false)
    {
    	checked = true;
    	checkValue = theForm.elements.length;
    }
    else
    {
    	checked = false;
    	checkValue = 0;
    }
    
    var countCheckBox = 0;
    var i;
    for (i=0; i<theForm.elements.length; i++) {
        if (theForm.elements[i].name=='cid[]'){
            theForm.elements[i].checked = checked;
            countCheckBox++;
        }
    }
    
    if (checked == true)
    {
    	checkValue = countCheckBox;
    }
    else
    {    	
    	checkValue = 0;
    }
}

